<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue中的数据类型的操作</title>
    <script src="js/vue.js"></script>
    <style>
        .box{
            width: 200px;
            height: 200px;
            background-color: red;
        }
    </style>
</head>

<body>
    <div id="app">
        <h3>{{flag?"对":"错"}}</h3>
        <button @click="change">切换</button>
        <div class="box" v-if="flag">
            内容 1
        </div>

        <div class="box" v-show="flag">
            内容 2
        </div>
        
    </div>

</body>
<script>
    new Vue({
        el: "#app",
        data: {
            flag:true

        },
        methods:{
            change(){
                this.flag =!this.flag;
            }
        }
    })



</script>

</html>